package Gui;

import java.awt.BorderLayout;
import java.util.ArrayList;

import javax.swing.JPanel;

public class GuiBuilder {

private ArrayList<JPanel> contentViewList = new ArrayList<JPanel>();
private NavigationPanel navigation;
private JPanel contentViewPanel;
private MainFrame frame;


	public GuiBuilder() {
		generateMainFrame();
		generateNavigation();
		generateContentView();
		
		setupNavigationPanelItems();
		
		frame.add(navigation,BorderLayout.LINE_START);
		frame.add(contentViewPanel,BorderLayout.CENTER);
	}

	private void generateContentView() {
		
		loadContentPanels();
		contentViewPanel = new TestContentPanelView(0, 0, 0);
		Controller.getInstance().setContentViewPanel(contentViewPanel);
	}

	private void generateMainFrame(){
		frame = new MainFrame("Test",300, 200);
		Controller.getInstance().setMainFrame(frame);
	
	}
	
	private void generateNavigation(){
		navigation = new NavigationPanel();
		Controller.getInstance().setNavigation(navigation);
	}
	
	
	private void loadContentPanels(){
		TestContentPanelView contentPanel = new TestContentPanelView(143,0,0);
		contentViewList.add(contentPanel);
		contentViewList.add(contentPanel);
		contentViewList.add(contentPanel);
		contentViewList.add(contentPanel);
		contentViewList.add(contentPanel);

	
		
	}
	
	private void setupNavigationPanelItems(){
		for (JPanel panel : contentViewList){
		navigation.addMenuItem(panel);
		}
	}

}